package org.marketlive.entity.attributes;

/*
(C) Copyright MarketLive. 2006. All rights reserved.
MarketLive is a trademark of MarketLive, Inc.
Warning: This computer program is protected by copyright law and international treaties.
Unauthorized reproduction or distribution of this program, or any portion of it, may result
in severe civil and criminal penalties, and will be prosecuted to the maximum extent
possible under the law.
*/

import java.io.Serializable;

/**
 * Represents an administrable property.
 * Attributes can be applied to catalog entities such as products, SKUs, and categories.
 */
public interface IAttribute extends Comparable, Serializable {

    /** Constant that represents the CREATED status for attributes. */
    public static final int CREATED = 0;

    /** Constant that represents the ADDED status for attributes. */
    public static final int ADDED = 1;

    /** Constant that represents the UPDATED status for attributes. */
    public static final int UPDATED = 2;

    /** Constant that represents the DELETED status for attributes. */
    public static final int DELETED = 3;

    /**
     * Returns the key of this attribute.
     *
     * @return the key of this attribute
     */
    public IAttributeKey getAttributeKey();

    /**
     * Sets the key of this attribute.
     *
     * @param attributeKey the key of this attribute
     */
    public void setAttributeKey(IAttributeKey attributeKey);

    /**
     * Returns the value of this attribute.
     * @return the value of this attribute
     */
    public Object getAttributeValue();

    /**
     * Sets the value of this attribute.
     *
     * @param attributeValue the value of this attribute
     */
    public void setAttributeValue(Object attributeValue);

    /**
     * Returns the name of the type of this attribute.
     *
     * @return the name of this attribute's type
     */
    public String getAttributeType();

    /**
     * Sets the name of this attribute's type.
     *
     * @param attributeType the name of this attribute's type
     */
    public void setAttributeType(String attributeType);

    /**
     * Returns the attribute type of this attribute.
     * @return the attribute type of this attribute
     */
    public IAttributeType getAttributeTypeDO();

    // ----------------------------------------------------------------------------------------------------------------
    /*
        Methods from IDataObject
        TODO
            1) 'delete'( make sure that there are no usages implementaion are OK) the methods that Attribute does not
            need make sure that the class fields are not used in any tags for display.
    */

    /**
     * Returns the unique identifier of this attribute's type.
     *
     * @return the unique identifier of this attribute's type
     */
    Integer getAttributeTypeID();

    /**
     * Sets the unique identifier of this attribute's type.
     *
     * @param id the unique identifier of this attribute's type
     */
    void setAttributeTypeID(Integer id);

    /**
     * Returns the status of this attribute.
     * Must be one of {@link #CREATED}, {@link #ADDED}, {@link #UPDATED}, {@link #DELETED}.
     *
     * @return the status of this attribute
     */
    public int getStatus();

    /**
     * Sets the status of this attribute.
     * Must be one of {@link #CREATED}, {@link #ADDED}, {@link #UPDATED}, {@link #DELETED}.
     *
     * @param status the status of this attribute
     */
    public void setStatus(int status);

    /**
     * Returns the identifier of this attribute.
     * Not implemented in the default implementation.
     * @return the identifier of this <code>IAttribute</code>
     */
    public Integer getID();

    /**
     * Sets the identifier of this attribute.
     * Not implemented in the default implementation.
     * @param id the identifier of this <code>IAttribute</code>
     */
    public void setID(Integer id);

    /**
     * Returns the name of this attribute.
     * Used by SkuAttributeVO.getName(), which is not used in the default implementation.
     *
     * @return the name of this attribute
     */
    public String getName();

    /**
     * Sets the name of this attribute.
     * Used by SkuHelper.prepareAttributeViewList().
     *
     * @param name the name of this attribute
     */
    public void setName(String name);

    /**
     * Returns the description of this attribute.
     * Not implemented in the default implementation.
     * @return the description of this attribute
     */
    public String getDescription();

    /**
     * Sets the description of this attribute.
     * Not implemented by the default implementation.
     * @param description the description of this attribute
     */
    public void setDescription(String description);

    /**
     * Returns the date this attribute was created.
     * Not implemented by the default implementation.
     * @return the date this attribute was created
     */
    public long getDateCreate();

    /**
     * Sets the date this attribute was created.
     * Not implemented by the default implementation.
     * @param dateCreate the date this attribute was created
     */
    public void setDateCreate(long dateCreate);

    /**
     * Returns the date this attribute is active.
     * Not implemented by the default implementation.
     * @return the date this attribute is active
     */
    public long getDateActivate();

    /**
     * Sets the date this attribute is active.
     * Not implemented by the default implementation.
     * @param dateActivate the date this attribute is inactive
     */
    public void setDateActivate(long dateActivate);

    /**
     * Returns the date this attribute is deactivated.
     * Not implemented by the default implementation.
     * @return the date this attribute is deactivated
     */
    public long getDateDeactivate();

    /**
     * Sets the date this attribute is deactivated.
     * Not implemented by the default implementation.
     * @param dateDeactivate the date this attribute is deactivated
     */
    public void setDateDeactivate(long dateDeactivate);

    /**
     * Returns the date this attribute is deleted.
     * Not implemented by the default implementation.
     * @return the date this attribute is deleted
     */
    public long getDateDeleted();

    /**
     * Sets the date this attribute is deleted.
     * Not implemented by the default implementation.
     * @param dateDeleted the date this attribute is deleted
     */
    public void setDateDeleted(long dateDeleted);

    /**
     * Returns the date this attribute is modified.
     * Not implemented by the default implementation.
     * @return the date this attribute is modified
     */
    public long getDateModified();

    /**
     * Sets the date this attribute is modified.
     * Not implemented by the default implementation.
     * @param dateModified the date this attribute is modified
     */
    public void setDateModified(long dateModified);

    /**
     * Returns true if this attribute is marked deleted, false otherwise.
     * Not implemented by the default implementation.
     * @return true if this attribute is marked deleted
     */
    public boolean isDeleteFlag();

    /**
     * Sets the delete flag for this attribute.
     * Not implemented by the default implementation.
     * @param deleteFlag true if this attribute is marked deleted
     */
    public void setDeleteFlag(boolean deleteFlag);

    /**
     * Returns the ordinal of this attribute.
     * Not implemented by the default implementation.
     * @return the ordinal of this attribute
     */
    public int getOrdinal();

    /**
     * Sets the ordinal of this attribute.
     * Not implemented by the default implementation.
     * @param ordinal the ordinal of this attribute
     */
    public void setOrdinal(int ordinal);

    // ---------------------------------------End copied methods from IDataObject -------------------------------------

}
